#include <iostream>
#include <string.h>
using namespace std;

struct Student
{
    char name[20];
    int age;
};
void fun1(struct Student s) // 值传递，不改变实参
{
    cout << "请输入姓名:" << endl;
    cin >> s.name;
    cout << "请输入年龄:" << endl;
    cin >> s.age;
}

void fun2(struct Student &s) // 引用传递，改变实参
{
    cout << "请输入姓名:" << endl;
    cin >> s.name;
    cout << "请输入年龄:" << endl;
    cin >> s.age;
}

int main()
{
    Student stu; // 定义一个结构体变量stu
    fun2(stu);
    cout << stu.name << endl;
    cout << stu.age << endl;
}